package ibm.cognos.imt

import groovy.util.slurpersupport.GPathResult
import ibm.cognos.imt.template.AbstractTemplate

/**
 * Created with IntelliJ IDEA.
 * User: eric
 * Date: 4/23/14
 * Time: 4:43 PM
 * To change this template use File | Settings | File Templates.
 */
class ReportElement {
    GPathResult domNode
    AbstractTemplate template

    def GPathResult getDomNode() {
        if (domNode == null) {
            domNode = getTemplate().getTemplateNode()
        }
        return domNode
    }

    def AbstractTemplate getTemplate() {
        if (template == null) {
            throw new RuntimeException("Oops, where is my template?")
        }
        return template
    }
}
